import java.util.*;
import java.io.*;

/*
Search/List movie for showtimes 
Additional Task (LINK WITH 1)
Configure system settings 
*/



public class CinemaApp {
	
	public static void main(String arg[]){
		searchMovie("aa");
		
	}
	

	public static void searchMovie(String movieName){
		
		String filename = "Movies_data.txt";
		
		boolean found = false;
		try{
			ArrayList al = TextDB.readMovies(filename);
			for(int i = 0;i<al.size();i++){
				Movie movie = (Movie)al.get(i);
				if (movie.getName().equalsIgnoreCase(movieName)){
					found = true;
					System.out.println();
					System.out.print("Title:" + movie.getName()+" ");
					System.out.print("Date:" + movie.getDate()+" ");
					System.out.print("Status:" + movie.getStatus()+" ");
					System.out.print("Price:" + movie.getPrice()+"SGD");
				}
			}
			
			if(!found){
				System.out.println("Movie not found");
			}
			
		}catch(IOException e){
			System.out.println("IOException > " + e.getMessage());
		}
		
		
	}
	
	

}
